package com.panku.util;

public class AESKit {

	/**
	 * 加密解密字符串
	 * @param s 要加密或者解密的字符串
	 * @return 加密或解密的字符串
	 */
	public static String encryStr(String s) {
		String AStr = "UXtnGjc4dIBkosvCPQSrDYFZJhTewliyLMaH70uW95xbVzOKq3E1Rmpf8AN62g";
	     int m = 0;
	     String STemp = "";
	     String c;
	     m = s.length();
	     for (int i = 0; i < m; i++) {
	         c = "";
	         c = c + s.substring(i, i + 1);
	         // System.out.println("AStr.indexOf(c)======"+AStr.indexOf(c));
	         if (AStr.contains(c)) {
	             STemp = STemp + AStr.substring((AStr.length() - 1) - AStr.indexOf(c), AStr.length() - AStr.indexOf(c));
	         } else {
	             STemp = STemp + c;
	         }
	     }
	     return STemp;
	}
	
	public static void main(String[] args) {
		System.out.println("smartmed90:"+encryStr("smartmed90"));
		System.out.println("vloveitit:"+encryStr("vloveitit"));
		System.out.println("SmartPQMS:"+encryStr("SmartPQMS"));
		System.out.println("SmartPQMS:"+encryStr("INTERFACE_PDJH"));
	}
}
